package com.android.fragmentdemo.defineviews
import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import androidx.recyclerview.widget.RecyclerView

class ChildRecyclerView @JvmOverloads constructor(
    context: Context,
    attributeSet: AttributeSet? = null
) : RecyclerView(context, attributeSet) {

    override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
        //通知父层ViewGroup不要拦截点击事件
        parent.requestDisallowInterceptTouchEvent(true)
        return super.dispatchTouchEvent(ev)
    }
}